package dialogencapsulation.qu.com.dialogencapsulation.InputBox.emoji;

import android.content.Context;
import android.widget.EditText;


import dialogencapsulation.qu.com.dialogencapsulation.InputBox.InputHelper;
import dialogencapsulation.qu.com.dialogencapsulation.InputBox.face.FacePanelView;
import dialogencapsulation.qu.com.dialogencapsulation.InputBox.face.FaceRecyclerView;
import dialogencapsulation.qu.com.dialogencapsulation.util.TDevice;

/**
 * Created by haibin
 * on 2016/11/10.
 */

public class EmojiView extends FacePanelView {
    private EditText mEditText;
    public EmojiView(Context context, EditText editText) {
        super(context);
        this.mEditText = editText;
        setListener(new FacePanelView.FacePanelListener() {
            @Override
            public void onDeleteClick() {

                InputHelper.backspace(mEditText);
            }

            @Override
            public void hideSoftKeyboard() {

                TDevice.hideSoftKeyboard(mEditText);
            }

            @Override
            public void onFaceClick(Emojicon v) {

                InputHelper.input2OSC(mEditText, v);
            }
        });
    }

    @Override
    protected FaceRecyclerView createRecyclerView() {
        return new EmojiRecyclerView(getContext(), this);
    }
}
